<template>
	<view class="page-section-spacing">
		<!-- <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1500">
			<swiper-item v-for="(item, index) in urllist" :key="index"><image :src="item" mode="aspectFill"></image></swiper-item>
		</swiper> -->
		<imgsBanner :imgList='urllist' :currentImg='currentImg'></imgsBanner>
		<text class="content">{{ content }}</text>
		<view class="tag">
			<view class="tag-view"  v-for="item in label">
			{{item}}
			</view>
		</view>
		
		<view class="time">{{Time}}</view>
	</view>
</template>

<script>
import imgsBanner from '../../components/imgsBanner-tag/imgsBanner-tag.vue'
export default {
	components:{
		imgsBanner
					},
	data() {
		return {
			inId:0,
			urllist: [],
			content: '',
			label: [],
			Time:'',
			inverted: false,
			currentImg:0
		};
	},
	onLoad(options) {
		var that=this;
		this.inId=JSON.parse(options.data);
		uni.request({
			url: this.$serverUrl + '/app/hospital/brandMarketing/getBrandMarketingInfo', //仅为示例，并非真实接口地址。
			data: {
				id:this.inId
			},
			method: 'POST',
			header: {
				'token': uni.getStorageSync('token'),
				'content-type': 'application/json',
				'content-type': 'application/x-www-form-urlencoded'
			},
			success: res => {
				
				console.log(res.data);
				try {
					uni.setStorageSync('data', JSON.stringify(res.data));
				} catch (e) {}
		
				if (res.data.code == 0) {
					uni.getStorageSync('token', res.data.token);
					console.log(res.data.data.label);
					console.log(res.data.data.content);
					console.log(res.data.data.createTime);
					that.urllist = res.data.data.url.split(',');
					that.content = res.data.data.content;
					that.label = res.data.data.label.split(',');
					that.Time=res.data.data.createTime
				} else {
					uni.showToast({
						title: res.data.msg,
						duration: 2000
					});
				}
			}
		});
	},

	methods: {
		
		
	}
}
</script>

<style>
.page-section-spacing {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 100vh;
}
.swiper {
	height: 750upx;
}

/* swiper-item 里面的图片高度 */
swiper-item image {
	width: 100%;
	height: 750upx;
}

.content {
	color: #555555;
	margin: 30upx;
	font-size: 30upx;
	height: ;
}

.tag-view {
	color: #0079c3;
	/* border-left-style:soild;
	border-left-width: 1upx;
	border-left-color: #0079C3;
	border-bottom-style: solid;
	border-bottom-width: 1upx;
	border-bottom-color: #ddd;
	background-color: #fff; */
	display: flex;
	flex-direction: row;
	padding-left: 10upx;
	padding-right: 10upx;
	text-align: center;
	justify-content: center;
	border-style: solid;
	border-width: 1upx;
	border-color: #0079c3;
	/* width: 150upx; */
	height: 60upx;
	line-height:60upx;
	font-size: 30upx;
	margin:0upx 20upx 0upx 0upx;
}
.tag{
	margin:0upx 30upx;
	display: flex;
	width: fit-content;
	flex-direction: row;
	
}
.time{
	/* #ifndef APP-PLUS-NVUE */
	display: flex;
	/* #endif */
	flex-direction: column;
	/* border-style: solid;
	border-width: 1upx;
	border-color: #0079c3;
	color: #0079c3; */
	/* border-left-style:soild;
	border-left-width: 1upx;
	border-left-color: #0079C3;
	border-bottom-style: solid;
	border-bottom-width: 1upx;
	border-bottom-color: #ddd;
	background-color: #fff; */
	margin-left: 30upx;
	margin-top: 40upx;
	/* width: 150upx; */
	height: 60upx;
	font-size: 30upx;
	
	
}
.button-view {
	width: 750upx;
	margin-top: 200upx;
	flex-direction: column;
}
.handle {
	width: inherit;
}
</style>
